import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:flutter/material.dart';

class NormalFormWrapper extends StatelessWidget {
  final Widget child;
  final double topPadding;
  final double bottomPadding;
  final double leftPadding;
  final double rightPadding;
  final bool hasBottomBorder;
  final bool hasTopBorder;
  final Color backgroundColor;

  const NormalFormWrapper(
      {Key key,
      this.backgroundColor,
      this.hasBottomBorder,
      this.hasTopBorder,
      this.topPadding,
      this.bottomPadding,
      this.leftPadding,
      this.rightPadding,
      this.child})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
        left: leftPadding ?? getDp(35),
        right: rightPadding ?? getDp(35),
        top: topPadding ?? getDp(25),
        bottom: bottomPadding ?? getDp(25),
      ),
      decoration: BoxDecoration(
        color: backgroundColor,
        border: Border(
          bottom: hasBottomBorder == true
              ? BorderSide(color: aceGrayColor, width: getDp(0.5))
              : BorderSide.none,
          top: hasTopBorder == true
              ? BorderSide(color: aceGrayColor, width: getDp(0.5))
              : BorderSide.none,
        ),
      ),
      child: child,
    );
  }
}
